import request from '@/config/axios'

// 历史搜索 VO
export interface HistorySearchVO {
  id: number // 主键
  title: string // 搜索
}

// 历史搜索 API
export const HistorySearchApi = {
  // 查询历史搜索分页
  getHistorySearchPage: async (params: any) => {
    return await request.get({ url: `/system/history-search/page`, params })
  },

  // 查询历史搜索详情
  getHistorySearch: async (id: number) => {
    return await request.get({ url: `/system/history-search/get?id=` + id })
  },

  // 新增历史搜索
  createHistorySearch: async (data: HistorySearchVO) => {
    return await request.post({ url: `/system/history-search/create`, data })
  },

  // 修改历史搜索
  updateHistorySearch: async (data: HistorySearchVO) => {
    return await request.put({ url: `/system/history-search/update`, data })
  },

  // 删除历史搜索
  deleteHistorySearch: async (id: number) => {
    return await request.delete({ url: `/system/history-search/delete?id=` + id })
  },

  // 导出历史搜索 Excel
  exportHistorySearch: async (params) => {
    return await request.download({ url: `/system/history-search/export-excel`, params })
  }
}